package com.zw.cloud.mybatis.plus.controller.stenter;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zw.cloud.global.response.wrapper.entity.WebResult;
import com.zw.cloud.mybatis.plus.entity.stenter.OptimizeCraft;
import com.zw.cloud.mybatis.plus.entity.stenter.OptimizeCraftDTO;
import com.zw.cloud.mybatis.plus.entity.stenter.OptimizeCraftPageQueryDTO;
import com.zw.cloud.mybatis.plus.service.api.stenter.IOptimizeCraftService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 定型可优化工艺 前端控制器
 * </p>
 *
 * @author zw
 * @since 2024-01-17
 */
@RestController
@RequestMapping("/optimize-craft")
public class OptimizeCraftController {

    @Autowired
    private IOptimizeCraftService optimizeCraftService;

    /**
     * 分页查询可优化工艺
     */
    @PostMapping("/pageQueryOptimizeCraft")
    public WebResult<Page<OptimizeCraft>> pageQueryOptimizeCraft(@RequestBody OptimizeCraftPageQueryDTO pageQueryDTO) {
        return WebResult.success(optimizeCraftService.pageQueryOptimizeCraft(pageQueryDTO));
    }

    /**
     * 可优化工艺详情
     */
    @GetMapping("/queryOptimizeCraftById/{id}")
    public WebResult<OptimizeCraftDTO> queryOptimizeCraftById(@PathVariable Long id) {
        return WebResult.success(optimizeCraftService.queryOptimizeCraftById(id));
    }

}
